﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forum.DataAccess.DbModel;

namespace Forum.DataAccess
{
    /// <summary>
    /// Provides incapsulated access to the data base. 
    /// </summary>
    public class DataManager
    {

        private PlForumEntities Context { get; set; }

        public DataManager()
        {
            Context = new PlForumEntities();
        }

        public Thread GetThread(int id)
        {
            if (id == 0)
                throw new ArgumentException("id is Guid.Empty");

            return (from t in Context.Threads
                    where t.Id == id
                    select t).SingleOrDefault();
        }


    }
}
